<template>
	<view class="so-the-search">
		<view class="top">
			<view class="menu" v-for="(item, index) in menus" @click="menuClick(item)">
				<image :src=" '/static/images/index/so-the-search/' + item.img + '.png' " mode=""></image>
				<text>{{ item.text }}</text>
			</view>
			
		</view>
		<view class="separate"></view>
		<view class="bottom">
			<view class="sites" v-for="(item, index) in sites" @click="skipCollect(item)">
				<image :src=" '/static/images/index/so-the-search/' + item.img + '.png' " mode=""></image>
				<text>{{ item.text }}</text>
				<text>{{ item.version }}</text>
			</view>
		</view>
		<wyb-popup ref="popup" type="center" width="500" radius="6" :showCloseIcon="true">
		    <view class="popup-content">
		        更新中, 请稍后...
		    </view>
		</wyb-popup>
	</view>
</template>

<script>
	import wybPopup from '@/components/wyb-popup/wyb-popup.vue'
	export default{
		//全网搜索
		name: 'soTheSearch',
		data() {
			return {
				//top 菜单
				menus: [
					{
						id: 1,
						img: 'my-collection',
						text: '我的采集'
					},{
						id: 2,
						img: 'my-export',
						text: '我的导出'
					},{
						id: 3,
						img: 'usinghelp',
						text: '使用帮助'
					},
					
				],
				//各站点
				sites: [
					{
						id: 1,
						img: 'baidu-map',
						text: '百度地图',
						version: '1.0.2',
						
					},{
						id: 2,
						img: 'gaode-map',
						text: '高德地图',
						version: '1.0.2'
					},{
						id: 3,
						img: 'tengxun-map',
						text: '腾讯地图',
						version: '1.0.2'
					},{
						id: 4,
						img: 'huicong',
						text: '慧聪网',
						version: '1.0.2',
						updating: true, //暂不可进  更新中
						indexWeb: 'https://m.hc360.com/',
						webSit: 'https://m.hc360.com/',
						searchWord: 'search/nothot?keyword='
					},{
						id: 5,
						img: 'china-gong',
						text: '中国供应商',
						version: '1.0.2',
						webSit: '',
						searchWord: '',
						updating: true, //暂不可进  更新中
					},{
						id: 6,
						img: 'enterprise-yellow',
						text: '企业黄页',
						version: '1.0.2',
						indexWeb: 'https://m.huangye88.com/',
						webSit: 'https://m.huangye88.com/',
						searchWord: 's?kw=挖&type=sale'
					},{
						id: 7,
						img: 'alibb',
						text: '阿里巴巴',
						version: '1.0.2',
						indexWeb: 'https://mind.1688.com/wap/wapsy/dke4eosa0/index.html?pageId=1150842&cms_id=1150842?cosite=baidujj_pz&keywordid=&trackid=885662561117990122602&location=',
						webSit: 'https://mind.1688.com/',
						searchWord: 'offer_search/-6D7033.html?keywords='
					},{
						id: 8,
						img: 'listweb',
						text: '列表网',
						indexWeb: 'http://m.liebiao.com/jinan/',
						webSit: 'http://m.liebiao.com/jinan/',
						searchWord: '',
						version: '1.0.2'
					},{
						id: 9,
						img: 'Information-network',
						text: '行业信息网',
						version: '1.0.2',
						updating: true, //暂不可进  更新中
					},{
						id: 10,
						img: 'dianping',
						text: '大众点评',
						version: '1.0.2',
						indexWeb: 'https://m.dianping.com/',
						webSit: 'https://m.dianping.com/',
						searchWord: 'shoplist/22/search?from=m_search&keyword=',
					},{
						id: 11,
						img: 'yiwugou',
						text: '义乌购',
						version: '1.0.2',
						indexWeb: 'https://wap.yiwugo.com/',
						webSit: 'https://wap.yiwugo.com/',
						searchWord: 'search?q=袜子&marketCode=10&spm=d2FwLnlpd3Vnby5jb20v.d2FwLnlpd3Vnby5jb20vc2VhcmNo',
						updating: true, //暂不可进  更新中
					},{
						id: 12,
						img: 'yishang',
						text: '亿商网',
						version: '1.0.2',
						indexWeb: 'http://m.eb80.com/',
						webSit: 'http://m.eb80.com/',
						searchWord: 'gongying______________桌子_1.html'
					},
				]
			}
		},
		components:{
			wybPopup
		},
		methods: {
			//点击菜单  跳转 我的采集  我的导出   使用帮助
			menuClick(val) {
				let url;
				switch (val.id) {
					case 1:
						url = './mySearch?id='+ val.id
					break;
					case 2:
						url = './myExport?id='+ val.id
					break;
					case 3:
						url = './helpCenter'
				}
				uni.navigateTo({
					url: url
				})
			},
			//跳转各网站搜集信息
			skipCollect(val) {
				if(val.updating) {
					this.$refs.popup.show() // 显示
				}else if(val.id > 3) {
					uni.navigateTo({
						url: '../collect/siteAcquisition?obj='+ encodeURIComponent(JSON.stringify(val)),
					})
				}else {
					if(val.id == 1) {
						uni.navigateTo({
							url: '../collect/baiduCollect'
						})
						
					}else if(val.id == 2) {
						this.$refs.popup.show() // 显示
					}else if(val.id == 3) {
						uni.navigateTo({
							url: '../collect/mapCollect'
						})
					}
					
				}
				
			}
		}
	}
</script>

<style lang="less" scoped>
	.flex{
		display: flex;
	}
	.so-the-search{
		.top{
			.flex;
			text-align: center;
			align-items: center;
			.menu{
				width: 246rpx;
				padding: 40rpx 0;
				margin-right: 6rpx;
				border-right: 6rpx solid #eee;
				background: #fff;
				image{
					width: 45rpx;
					height: 45rpx;
					margin: auto;
					display: block;
				}
				text{
					margin-top: 15rpx;
					display: block;
				}
			}
			.menu:last-child{
				border-right: none;
			}
		}
		.separate{
			width: 100%;
			height: 14rpx;
			background: #EEEEEE;
		}
		.bottom{
			.flex;
			text-align: center;
			align-items: center;
			flex-wrap: wrap;
			.sites{
				width: 25%;
				padding: 60rpx 0;
				background: #fff;
				image{
					width: 104rpx;
					height: 104rpx;
					margin: auto;
					display: block;
				}
				text{
					margin-top: 15rpx;
					display: block;
				}
			}
		}
	}
</style>
